<template>
  <el-switch
    v-model="scope.row[prop]"
    :active-value="nodeItem.activeValue||true"
    :inactive-value="nodeItem.inactiveValue||false"
    @click="change(scope)"
    :disabled="!nodeItem.url"
  >
  </el-switch>
</template>
<script setup>
import { deepClone } from "@/utils/arr";
import { ref, computed,watch } from "vue";
import { parsingJson } from '@/utils/parsing'
const emit = defineEmits(["editData","confirmDelClick"]);
const props = defineProps({
  nodeItem: {
    type: Object,
    defalut: {},
  },
  scope: {
    type: Object,
    defalut: {},
  },
  prop: {
    type: String,
    defalut: "",
  }
});
const change = () => {
  if (props.nodeItem.url &&props.scope.row) {
    let data = parsingJson(props.scope.row,props.nodeItem);
    emit("confirmDelClick", props.nodeItem.url, data);
  }
};
</script>
